﻿@model IList<CMSApplication.Models.HtmlElement>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/MySite/MySiteMasterPage.cshtml";
}


<div class="header">
    @foreach (var element in Model)
    {
        if (element.WhereOnPage == "header")
        {
            ViewContext.Writer.Write("<" + element.ElementType + " id='" + element.ID + "' name='" + element.Name + "' style='" + element.Style + "'>");
            ViewContext.Writer.Write(element.InnerHtml);
            ViewContext.Writer.Write("</" + element.ElementType + ">");
        }
    }
</div>
<div class="topmenu">
    @foreach (var element in Model)
    {
        if (element.WhereOnPage == "topmenu")
        {
             ViewContext.Writer.Write("<" + element.ElementType + " id='" + element.ID + "' name='" + element.Name + "' style='" + element.Style + "'>");
            ViewContext.Writer.Write(element.InnerHtml);
            ViewContext.Writer.Write("</" + element.ElementType + ">");
        }
    }
</div>
<div class="maincontent">
    <div class="leftsidebar">
        @foreach (var element in Model)
        {
            if (element.WhereOnPage == "leftsidebar")
            {
                 ViewContext.Writer.Write("<" + element.ElementType + " id='" + element.ID + "' name='" + element.Name + "' style='" + element.Style + "'>");
                ViewContext.Writer.Write(element.InnerHtml);
                ViewContext.Writer.Write("</" + element.ElementType + ">");
            }
        }
    </div>
    <div class="content">
        @foreach (var element in Model)
        {
            if (element.WhereOnPage == "content")
            {
                 ViewContext.Writer.Write("<" + element.ElementType + " id='" + element.ID + "' name='" + element.Name + "' style='" + element.Style + "'>");
                ViewContext.Writer.Write(element.InnerHtml);
                ViewContext.Writer.Write("</" + element.ElementType + ">");
            }
        }
    </div>
    <div class="rightsidebar">
        @foreach (var element in Model)
        {
            if (element.WhereOnPage == "rightsidebar")
            {
                 ViewContext.Writer.Write("<" + element.ElementType + " id='" + element.ID + "' name='" + element.Name + "' style='" + element.Style + "'>");
                ViewContext.Writer.Write(element.InnerHtml);
                ViewContext.Writer.Write("</" + element.ElementType + ">");
            }
        }
    </div>
</div>
<div class="footer">
    @foreach (var element in Model)
        {
            if (element.WhereOnPage == "footer")
            {
                 ViewContext.Writer.Write("<" + element.ElementType + " id='" + element.ID + "' name='" + element.Name + "' style='" + element.Style + "'>");
                ViewContext.Writer.Write(element.InnerHtml);
                ViewContext.Writer.Write("</" + element.ElementType + ">");
            }
        }
</div>
